﻿<UserControl x:Class="TED.View.ItemView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
    mc:Ignorable="d"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    d:DesignHeight="480" d:DesignWidth="480">

    <Grid x:Name="LayoutRoot" Background="Transparent">
        <StackPanel>
                    <TextBlock Text="Tap and hold, choose add default *.wmv video to test. Because Emulator for Wp7 does not support playing *.mp4" 
                               Name="defaultVideoTextBlock"
                               TextWrapping="Wrap"
                               FontSize="28"/>
                    <ListBox ItemsSource="{Binding}" x:Name="listBox" Height="500">
        <ListBox.ItemTemplate>
                <DataTemplate>
                    <StackPanel>
                        <toolkit:ContextMenuService.ContextMenu>
                            <toolkit:ContextMenu VerticalOffset="0.0" x:Name="contextMenu">
                                <toolkit:MenuItem Header="Like" Click="AddFavourite_Click"/>
                                <toolkit:MenuItem Header="Add To Playlist" Click="AddVideoToPlayList_Click"/>
                                    <toolkit:MenuItem Header="Add Default video" Click="GestureTap_AddDefaultVideo"/>
                                </toolkit:ContextMenu>
                        </toolkit:ContextMenuService.ContextMenu>
                        <Grid>
                            <toolkit:GestureService.GestureListener>
                                <toolkit:GestureListener
                                DoubleTap="GestureDoubleTap_PlayVideo"/>
                            </toolkit:GestureService.GestureListener>
                            <Image HorizontalAlignment="Left" 
                                           Height="99" Width="132" 
                                           Margin="5,5,0,5" 
                                           VerticalAlignment="Center" 
                                           Source="{Binding ImageUrl}">
                        </Image>
                        <StackPanel Grid.Column="1" Margin="200,5,5,5">
                            <TextBlock TextWrapping="Wrap" 
                                               VerticalAlignment="Top" 
                                               HorizontalAlignment="Left" 
                                               Text="{Binding Author}"/>
                            <TextBlock TextWrapping="Wrap" 
                                               VerticalAlignment="Top" 
                                               HorizontalAlignment="Left" 
                                               Text="{Binding Title}"/>
                            <HyperlinkButton Content="Play video" NavigateUri="{Binding ViewUrl}"/>
                        </StackPanel>
                    </Grid>
                    </StackPanel>
            </DataTemplate>
                
            </ListBox.ItemTemplate>
        </ListBox>
        </StackPanel>
    </Grid>
</UserControl>
